<?php 

Class FileUploader{
  
  public static $TMP_FOLDER = "";
  public static $STORE_FOLDER = "./uploadFiles";
  public static $FILE_TYPES = 'image/jpg,image/jpeg,image/gif,image/png';
 
  public static function generateFileName(){
    date_default_timezone_set("Asia/Shanghai");
    return date('sihdmY');
  }
  public static function getFileExt($fileName){
    $result =  explode(".",$fileName);
    return $result[1];
  }
  public static function isFileTypeAvaliable($fileExt){
    $types = explode(",",self::$FILE_TYPES);
    foreach($types as $t ){
      if($fileExt==$t){
        return true;
      }      
    }    
    return false;
  }
  
  
  
}
?>